/**
*  \file seppuku.h
*
*  \brief  	Delayed Reset
*
*  \author	Michael J. Hohmann <michael.hohmann@linde-mh.de>
*
*
*/
#ifndef SEPPUKU_H_INCLUDED
#define SEPPUKU_H_INCLUDED

/*================================================[ public includes  ]================================================*/
#include "../cfg/prj.h"
#include "../tasklet/tasklet.h"

/*================================================[ public defines   ]================================================*/

/*================================================[ public datatypes ]================================================*/

/*================================================[ public variables ]================================================*/

/*================================================[ public functions ]================================================*/
/**
*  Initialization.
*
*  Initialize the seppuku module in the end of the initialization phase.
*  seppuku_perform will then be called at the end of a time slice and ensures a correct timing behavior.
*
*  \param list:              Time slice that determines the time base.
*         reset_reason_addr: Address where a reset_reason can be stored before performing a reset.
*                            If pointer is NULL no reset reason will be stored.
*
*  \return Always RC_SUCCESS.
*/
RC seppuku_initialize( struct tasklet_list * const list, void (* const reset_function)(void), U32 * const reset_reason_addr );


/** Order an reset in advance.
*
*  The function seppuku_perform() arm a delayed reset.
*
*  \param delay:        Time span to the reset. The resolution is given by the time slice that was passed to the
*                       seppuku_initialize() routine.
*         reset_reason: Will be stored to initialized reset_reason_addr before perforimg the reset if address is not NULL.
*/
void seppuku_perform( const U32 delay, const U32 reset_reason );

/*====================================================================================================================*/

#endif

/***********************************************************************************************************************
*                             Copyright 2011 Linde Material Handling. All rights reserved.                             *
***********************************************************************************************************************/
